package com.d3works.apps.project.service;

import com.d3works.apps.base.db.Frequency;
import com.d3works.apps.project.db.Project;
import com.d3works.apps.project.db.ProjectPriority;
import com.d3works.apps.project.db.ProjectStatus;
import com.d3works.apps.project.db.ProjectTask;
import com.d3works.auth.db.User;
import com.d3works.meta.CallMethod;

public interface ProjectTaskService {

  /** Generates reccurent tasks from given {@link ProjectTask} and {@link Frequency} */
  void generateTasks(ProjectTask projectTask, Frequency frequency);

  /**
   * Updates fields of next task of given {@link ProjectTask}, recursively.
   *
   * <p>This method DOES NOT update potential parent.
   */
  void updateNextTask(ProjectTask projectTask);

  /** Removes all next tasks of given {@link ProjectTask}. */
  void removeNextTasks(ProjectTask projectTask);

  public ProjectTask create(String subject, Project project, User assignedTo);

  @CallMethod
  public ProjectStatus getDefaultCompletedStatus(Project project);

  @CallMethod
  public ProjectStatus getStatus(Project project);

  @CallMethod
  public ProjectPriority getPriority(Project project);

  void deleteProjectTask(ProjectTask projectTask);

  public String getTaskLink(String value);
}
